<?php

namespace WsdServer\Exception;

use Exception;

/**
 * Created by PhpStorm.
 * User: bobo
 * Date: 17-12-25
 * Time: 下午7:06
 */
class WsdException extends Exception
{
    protected $internal_code;
    protected $internal_msg;

    public function __construct($message, $code, $internal_msg="", $internal_code=0) {
        // Modify by hb on 2017-03-07: 允许 WsdException::internal_msg 为空
        /*
        if ($internal_msg==null) $internal_msg=$message;
        if ($internal_code==0) $internal_code=$code;
        */

        $this->internal_msg = $internal_msg;
        $this->internal_code = $internal_code;

        parent::__construct($message, $code);
    }

    final public function getInternalMsg() {
        return $this->internal_msg;
    }

    final public function getInternalCode() {
        return $this->internal_code;
    }
}